package com.mlf.prototype.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 展示 直接注入 Prototype Bean 的方式，原型 bean 会一直是同一个实例
 */
@Component
public class SingletonWithFakePrototypeBean {

    @Autowired
    private PrototypeBean prototypeBean;


    public void demonstratePrototype()
    {
        System.out.println("prototypeBean.getInstanceId() = " + prototypeBean.getInstanceId());
        System.out.println("prototypeBean.getInstanceId() = " + prototypeBean.getInstanceId());
    }
}
